package com.dk.service.impl;

import com.dk.mapper.SysAutoCodePartMapper;
import com.dk.pojo.SysAutoCodePart;
import com.dk.pojo.SysAutoCodePartExample;
import com.dk.pojo.SysAutoCodeRuleExample;
import com.dk.service.PartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PartServiceImpl implements PartService {

    @Autowired
    private SysAutoCodePartMapper partMapper;

    @Override
    public List<SysAutoCodePart> getpart() {
        return partMapper.selectByExample(null);
    }

    @Override
    public void insertpart(SysAutoCodePart part) {
        partMapper.insert(part);
    }

    @Override
    public void deleteById(Long id) {
        partMapper.deleteByPrimaryKey(id);
    }

    @Override
    public void deleteAllPart(List<String> ids) {
        partMapper.deleteAllPart(ids);
    }

    @Override
    public void updatepart(SysAutoCodePart part) {
        partMapper.updateByPrimaryKeySelective(part);
    }


    @Override
    public List<SysAutoCodePart> selectByRuleId(Long ruleId) {
        return partMapper.selectByRuleId(ruleId);
    }

    @Override
    public String selectByPartTypeAndRuleId(String partType, Long ruleId) {
        return partMapper.selectByPartTypeAndRuleId(partType,ruleId);
    }


}
